<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // const obj = {
      //   get fullName() {},
      // };
      // Object.defineProperty(obj, "fullName", {
      //   get() {},
      //   set() {},
      // });

      class Person {
        constructor() {
          this.firstName = "li";
          this.lastName = "jack";
          /* Object.defineProperty(this, "fullName", {
            get() {},
            set(value) {},
          }); */
        }
        get fullName() {
          return `${this.lastName} ${this.firstName}`;
        }
        set fullName(value) {
          [this.lastName, this.firstName] = value.split(" ");
        }
      }

      const p1 = new Person();
      console.log(p1);
    </script>
  </body>
</html>
